load('mnist/mp_3-5_data.mat');

%preprocessing
alpha_min=min(min(Xtrain));
alpha_max=max(max(Xtrain));
Xtrain=1/(alpha_max-alpha_min)*(Xtrain-alpha_min);
Xtest=1/(alpha_max-alpha_min)*(Xtest-alpha_min);

%dividing the training part into the training set and validation set
p=randperm(size(Xtrain,1));
k=round(size(Xtrain,1)*2/3);
Xtrainset=Xtrain(p(1:k),:);
Ytrainset=Ytrain(p(1:k));
Xvalidationset=Xtrain(p(k+1:end),:);
Yvalidationset=Ytrain(p(k+1:end));

